import request from '@/utils/request'

// 创建理发子项
export function createProductItem(data) {
  return request({
    url: '/lfd/product-item/create',
    method: 'post',
    data: data
  })
}

// 更新理发子项
export function updateProductItem(data) {
  return request({
    url: '/lfd/product-item/update',
    method: 'put',
    data: data
  })
}

// 删除理发子项
export function deleteProductItem(id) {
  return request({
    url: '/lfd/product-item/delete?id=' + id,
    method: 'delete'
  })
}

// 获得理发子项
export function getProductItem(id) {
  return request({
    url: '/lfd/product-item/get?id=' + id,
    method: 'get'
  })
}

// 获得理发子项分页
export function getProductItemPage(query) {
  return request({
    url: '/lfd/product-item/page',
    method: 'get',
    params: query
  })
}

// 导出理发子项 Excel
export function exportProductItemExcel(query) {
  return request({
    url: '/lfd/product-item/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 创建理发子项
export function listProduct(data) {
  return request({
    url: '/lfd/product/create',
    method: 'post',
    data: data
  })
}
